package com.houger.ddd.redpacket.facade.dto;

import com.houger.ddd.common.base.BaseDto;
import com.houger.ddd.common.utils.DateUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import java.time.LocalDateTime;

/**
 * @author Houger.
 * @date 2024年04月10日 10:17.
 */

@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class RedPacketDto extends BaseDto {
    @Schema(description ="userId")
    private String userId;
    @Schema(description ="redPacketId")
    private String redPacketId;
    private String totalAmount;
    private String totalCount;
    private String residualAmount;
    private String residualCount;
    private Integer isOnlyMinAmount = 0;
    private LocalDateTime sendTime;
    private LocalDateTime burnoutTime;

    public void setSendTime(String sendTime){
        this.sendTime= LocalDateTime.parse(sendTime, DateUtil.NORMAL_FORMATTER);
    }

    public void setBurnoutTime(final String burnoutTime) {
        this.burnoutTime = LocalDateTime.parse(burnoutTime, DateUtil.NORMAL_FORMATTER);
    }
}
